package com.qianyu.project.web.controller.wyh;

import com.qianyu.project.entity.ProviderType;
import com.qianyu.project.service.IProviderInfoService;
import com.qianyu.project.service.IProviderTypeService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * author wyh
 * Date 2021/2/3
 **/
@RestController
@RequestMapping("WyhProviderInfos")
public class WyhProviderTypeController {

    @Autowired
    private IProviderTypeService iProviderTypeService;

    @Autowired
    private IProviderInfoService iProviderInfoService;

    @GetMapping
    public Result list(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询所有项目类型
        List<ProviderType> providerType = iProviderTypeService.list();
        map.put("type", providerType);
        //查询所有项目
        map.put("data", iProviderInfoService.WyhCreatedList(params));
        return ResultTool.success(map);
    }

}
